

local key_user_N="User_"  ..KEYS[1]
local field_AtGatewayServerId="AtGatewayServerId"
local key_GatewayServer_N="GatewayServer_" ..KEYS[2]
local val_GatewayServerId=KEYS[2]

local val=redis.call("hget",key_user_N,field_AtGatewayServerId)
if(val == val_GatewayServerId) then
    redis.call("hdel",key_user_N,field_AtGatewayServerId)
    redis.call("hdel",key_GatewayServer_N,key_user_N)
    return 1
end
return 0